﻿<phone:PhoneApplicationPage 
    x:Class="CalciumTemplateApp.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c="clr-namespace:Outcoder.UI.Xaml.Controls;assembly=Outcoder.Calcium.WindowsPhone"
    xmlns:c2="clr-namespace:Outcoder.UI.Xaml;assembly=Outcoder.Calcium.WindowsPhone"
    xmlns:controls="clr-namespace:CalciumTemplateApp.Controls"
    xmlns:CalciumTemplateApp="clr-namespace:CalciumTemplateApp"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    shell:SystemTray.IsVisible="{Binding AppSettings.SystemTrayVisible, FallbackValue=true}"
    c2:VisualStateUtility.VisualState="{Binding VisualState}"
    Style="{StaticResource PageStyle}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait" 
    d:DataContext="{d:DesignInstance CalciumTemplateApp:MainViewModel}">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- The app and page title are presented with the TitleControl. -->
        <controls:TitleControl />

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            
        </Grid>

        <!-- AppBar enhances the built-in ApplicationBar control 
            to provide data-binding and various button types 
            including toggle buttons and hyperlink buttons etc. 
        
            This app bar contains various menu items that can remain in place.
            Registation and Review links use mock tasks when using a debug build configuration. 
            Phone task type registrations are performed in the BootStrapper class.
            A release build uses the production types.
        -->
        <c:AppBar>
            <c:AppBarHyperlinkButton 
                    NavigateUri="/Views/DashboardView/DashboardView.xaml"
                    Text="{Binding Resources.Instance.Commands_ViewDashboard, 
                                   Source={StaticResource Resources}}"
                    IconUri="/Assets/AppBar/appbar.feature.settings.rest.png" />
            <c:AppBar.MenuItems>
                <c:AppBarMenuItem
                    Command="{Binding RegisterCommand}"
                    Text="{Binding Resources.Instance.Commands_Register, 
                                   Source={StaticResource Resources}}" 
                    Visibility="{Binding MarketplaceService.Trial,
                                         Converter={StaticResource BooleanToVisibilityConverter}}" />
                <c:AppBarMenuItem
                    Command="{Binding ReviewCommand}"
                    Text="{Binding Resources.Instance.Commands_Review, 
                                   Source={StaticResource Resources}}" />
                <c:AppBarHyperlinkMenuItem
                    NavigateUri="/Views/DashboardView/DashboardView.xaml"
                    Text="{Binding Resources.Instance.Commands_ViewDashboard, 
                                   Source={StaticResource Resources}}" />

                <c:AppBarMenuItem
                    Command="{Binding BuyFullVersionCommand}"
                    Text="{Binding Resources.Instance.Commands_UpgradeToFullVersion, Source={StaticResource Resources}}"
                    Visibility="{Binding FreeVersion, Converter={StaticResource BooleanToVisibilityConverter}}" />
            </c:AppBar.MenuItems>
        </c:AppBar>
    </Grid>
 
</phone:PhoneApplicationPage>